package com.example.testproj;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.FrameLayout;

/**
 * @des:
 * @author: 芮勤
 * @date: 2019/4/17 19:37
 * @see {@link }
 */
public class MyLayout extends FrameLayout {
    private static final String TAG = "MainActivity";
    public MyLayout(Context context) {
        super(context);
    }

    public MyLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public MyLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }



    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        final int action = ev.getAction();
        final int actionMasked = action & MotionEvent.ACTION_MASK;
        if (actionMasked!=MotionEvent.ACTION_MOVE){
            Log.d(TAG, "dispatchTouchEvent: ev==="+actionMasked);
        }else {
//            Log.d(TAG, "dispatchTouchEvent: ev==="+actionMasked);
        }
        if (actionMasked==MotionEvent.ACTION_UP){
            Log.d(TAG, "dispatchTouchEvent: ev==="+actionMasked);
        }

        return super.dispatchTouchEvent(ev);
    }
}
